package com.mobily.teamaster.reports.client.screen;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalSplitPanel;
import com.mobily.teamaster.reports.client.Constants;


public class ReportHomeScreen extends Composite {
	
	ReportScreen activityReport;
	RatingReportScreen ratingReportsScreen;
	public ReportHomeScreen() {
		
		final HorizontalSplitPanel horizontalSplitPanel = new HorizontalSplitPanel();
		horizontalSplitPanel.setSplitPosition("20%");
		initWidget(horizontalSplitPanel);
		horizontalSplitPanel.setSize(Constants.UI.screenWidth+"px", Constants.UI.mainPaleteAreaHeight+"px");
		
		AbsolutePanel verticalPanel = new AbsolutePanel();
		horizontalSplitPanel.setLeftWidget(verticalPanel);
		verticalPanel.setSize("100%", "100%");
		
		Button btnNewContent = new Button("Activity Wise Resports");
		
		btnNewContent.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				if(activityReport == null)
					activityReport = new ReportScreen(); 
				
				horizontalSplitPanel.setRightWidget(activityReport);
			}
		});
		verticalPanel.add(btnNewContent, 10, 10);
		btnNewContent.setSize("200px", "");
		
		Button btnViewAll = new Button("Rating Wise Reports");
		btnViewAll.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
//				if(partnerContentsListScreen == null)
				ratingReportsScreen = new RatingReportScreen();
//				else
//					partnerContentsListScreen.refresh();
				horizontalSplitPanel.setRightWidget(ratingReportsScreen);
			}
		});
		verticalPanel.add(btnViewAll, 10, 57);
		btnViewAll.setSize("200px", "");
	}

}
